import Vue from 'vue'
import Router from 'vue-router'
import Msite from '../pages/Msite/Msite.vue'
import Search from '../pages/Search/Search.vue'
import Order from '../pages/Order/Order.vue'
import Profile from '../pages/Profile/Profile.vue'
import Login from '../pages/Login/Login.vue'
import Shop from '../pages/shop/Shop.vue'
import ShopGoods from '../pages/shop/ShopGoods.vue'
import Foods from '../pages/shop/Foods.vue'
import ShopInfo from '../pages/shop/ShopInfo.vue'
import ShopRatings from '../pages/shop/ShopRatings.vue'
import Erectsubtraction from '../pages/Erectsubtraction/Erectsubtraction.vue'
import header from '../components/header/header'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/msite'
    },
    {
      path: '/login',
      name:Login,
      component: Login
    },{
      path: '/Erectsubtraction',
      name: Erectsubtraction,
      component: reslove => require(['../pages/Erectsubtraction/Erectsubtraction.vue'], reslove)
    },{
      path: '/header',
      name: header,
      component: reslove => require(['../components/header/header.vue'], reslove)
    },{
      path: '/msite',
      name:Msite,
      component: Msite,
    },{
      path: '/search',
      component: Search,
    },
    {
      path: '/order',
      component: Order,
    },
    {
      path: '/profile',
      component: Profile,
    },
    {
      path: '/shop',
      component: Shop,
      children: [
        {
          path: '/shop/goods',
          component: ShopGoods,
          children:[
            {
              path: '/shop/goods/foods',
              component: Foods,
            }
          ]
        },
        {
          path: '/shop/ratings',
          component: ShopRatings
        },
        {
          path: '/shop/info',
          component: ShopInfo
        },
        {
          path: '',
          redirect: '/shop/goods'
        }
      ]
    },




  ]
})
